<?php
/**
 * Notes:
 * User:ZSLAA
 * DateTime: 2020/10/30 14:14
 */


namespace app\middleware;


use app\common;

class AdminCheck
{
    /**
     * 处理请求
     *
     * @param 	hinkRequest $request
     * @param Closure       $next
     * @return Response
     */
    public function handle($request, \Closure $next)
    {
        //验证登录
        if (!common::isLogin()) {
            return redirect(ADMIN_PATH.'/login');
        }

        return $next($request);
    }

}